#include "stm32f10x.h"                  // Device header
#include "OLED.h"


uint32_t JumpAppAddress = 0;

typedef void (*pFunction)(void);
pFunction BootApplication;

#define FLASH_BASE_ADDRESS ((uint32_t)0x08000000)	//flash基址
#define ApplicationAddress ((uint32_t)0x08002000)	//app地址

int main(void)
{	
	OLED_Init();
	OLED_ShowString(2,1,"Boot");
	JumpAppAddress = *(__IO uint32_t*)(ApplicationAddress + 4);	//set pc pointer
	BootApplication = (pFunction)JumpAppAddress;	
	__set_MSP(*(__IO uint32_t*)ApplicationAddress);		//set msp pointer
	
	__disable_irq();
	RCC_DeInit();
//	TIM_DeInit(TIM1);
	
	__enable_irq();
	BootApplication();
	
	
}

